#!/bin/bash

CURRENT_ENV=dev
if [ "${PACKAGE_LABEL}" == "testing" ];then
  CURRENT_ENV=test
  echo "current env is ${CURRENT_ENV}"
elif [ "${PACKAGE_LABEL}" == "staging" ];then
  CURRENT_ENV=pre
   echo "current env is ${CURRENT_ENV}"
elif [ "${PACKAGE_LABEL}" == "production" ];then
  CURRENT_ENV=prod
  echo "current env is ${CURRENT_ENV}"
else
  CURRENT_ENV=dev
  echo "current env is ${CURRENT_ENV}"
fi

sed -i "s/_REPLACE_ENV_/${CURRENT_ENV}/g" appctl.sh
mvn -U clean package -Dmaven.test.skip